home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1992 July / Nautilus-3-8 / Nautilus-3-8.bin / Tools & Utilities / Techy Stuff / Doco ƒ / CSMP ƒ / CSMP-V1-059.TXT < prev    next >
Encoding:
Text File  |  1992-06-03  |  41.8 KB  |  1,056 lines

  1. C.S.M.P. Digest             Sat, 25 Apr 92       Volume 1 : Issue 59
  2.  
  3. Today's Topics:
  4.  
  5.     Beta Testers
  6.     MPW C++ and "force_active" pragma
  7.     Finding out largest memory block in heap?
  8.     Outlining default button in a dialog; FAQ list solution fails
  9.     Electronic Publishing, That Is, Without Paper
  10.     Info on Copyrights and Distribution
  11.     Can anyone tell me about Prototyper?
  12.     OOP version of ThinkC
  13.     malloc() problem solved
  14.     KCAP resource format?
  15.     THINK C Problem
  16.     Does anyone have any source code/file formats for graphics files
  17.  
  18.  
  19. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  20.  
  21. These digests are available (by using FTP, account anonymous, your email
  22. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  23. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  24. Questions list.  The last several issues of the digest are available from
  25. sumex-aim.stanford.edu as well.
  26.  
  27. These digests are also available via email.  Just send a note saying that you
  28. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  29. automatically receive each new digest as it is created.
  30.  
  31. The articles in these digests are taken directly from comp.sys.mac.programmer.
  32. They are not edited; all articles included in this digest are in their original
  33. posted form.  The only articles that are -not- included in these digests are
  34. those which didn't receive any replies (except those that give information
  35. rather than ask a question).  All replies to each article are concatenated
  36. onto the original article in the order in which they were received.  Article
  37. threads are not added to the digests until the last article added to the
  38. thread is at least one month old (this is to ensure that the thread is dead
  39. before adding it to the digests).
  40.  
  41. Send administrative mail to mkelly@cs.uoregon.edu.
  42.  
  43. -------------------------------------------------------
  44.  
  45. From: rc05@gte.com (Ramesh Chandak)
  46. Subject: Beta Testers
  47. Date: 10 Mar 92 11:34:19 GMT
  48. Organization: GTE Laboratories Incorporated, Waltham MA
  49.  
  50. to all those who responded ( there were quite a few ) to my previous
  51. posting regarding looking for beta testers, first of all : Thanx much 
  52. for your interest.  I shall get in touch with each one of you soon,  with
  53. details of the product. 
  54.  
  55. - - Ramesh Chandak
  56. rc05@gte.com
  57.  
  58. +++++++++++++++++++++++++++
  59.  
  60. From: ingemar@isy.liu.se (Ingemar Ragnemalm)
  61. Date: 23 Mar 92 12:55:14 GMT
  62. Organization: Dept of EE, University of Linkoping
  63.  
  64.  
  65. BETA TESTERS WANTED:
  66.  
  67. A while ago, I put together a set of subroutines to deal with animation
  68. of icon-sized sprites over a background. Some of you may have seen the
  69. first result, the action game Slime Invaders. Though SI isn't a very
  70. polished game, it tells something about what you can do with the toolkit.
  71.  
  72. Now I have polished things up, written smaller demo programs, separated
  73. the game-specific code from the toolkit code, commented a bit more and
  74. written a first draft of a manual. The working name for it is "Sprite
  75. Animation Toolkit" (SAT). I intend to release it with full source code, free
  76. of charge, asking only to get copies of programs using the toolkit.
  77.  
  78. The toolkit includes a package to produce asynchronous sound. This package
  79. uses Sound Driver or Sound Manager depending on system version and whether
  80. or not Apple Sound Chip is present.
  81.  
  82. Current limitations: black-and-white graphics, uses a "Classic-sized"
  83. portion of the screen (but this is easily changed), only one window.
  84. Sound package uses only one channel. The code is halfway object oriented,
  85. but does *not* use Object Pascal.
  86.  
  87. Before releasing a package like this, I'd like to have some beta testers
  88. looking at it, trying to make some hacks with it and comment on the manual.
  89. So, if you have Think Pascal v4, and can answer any of the following questions
  90. with "yes", I'd like to hear from you.
  91.  
  92. Ordinary testing:
  93.  
  94. - - Would you like to try making a game (or other program) using the SAT
  95. toolkit? (Preferrably not Space Invaders or Pacman, I've made them already.)
  96. - - Do you enjoy nitpicking on lousy manuals?
  97.  
  98. Help developing a better toolkit:
  99.  
  100. - - Do you have or are you capable and willing to make optimized routines for
  101. drawing icons directly to the screen (without using QuickDraw) in assembly
  102. language for addition to the SAT toolkit? (Relatively easy task for someone
  103. who feels at home in Think C's inline assembly.)
  104. - - Are you capable and willing to make a color version of the SAT toolkit?
  105. (Hard task, I think. I'm stuck in the question of how to draw color icons
  106. directly to the screen with correct colors.)
  107. - - It shouldn't be too hard to hack SAT to *real* Object Pascal, for someone
  108. who uses Object Pascal a lot. Would you like to do this?
  109.  
  110. For the record, related packages:
  111. ================================
  112. I wouldn't have done this if there was something I knew of that would do the
  113. job. However, there are two other packages that have a similar ambition:
  114.  
  115. - - Vector Animation Toolkit by Juri Munkki. (Currently in beta test.) Great
  116. for making vector animations - but that is a totally different niche. Think C.
  117.  
  118. - - Offscreen Bitmap by John F. Hogg. (Also in beta test.) Uses Think C's
  119. TCL library, and in color! Basically it is a set of routines for offscreen
  120. pixmap management, as far as I'm able to tell. (The docs are very brief.)
  121.  
  122. While these packages are in color, SAT is so far only b/w, but it has more
  123. support for game writing, including two complete (but of course very simple)
  124. games with full source.
  125.  
  126. So, if you want to be a beta tester and/or contribute to the development of
  127. this package, and intend to spend some time on it and mail me feedback,
  128. please E-mail me at: ingemar@isy.liu.se
  129.  
  130. - -- 
  131. Ingemar Ragnemalm
  132. Dept. of Electrical Engineering         ...!uunet!mcvax!enea!rainier!ingemar
  133.                   ..
  134. University of Linkoping, Sweden         ingemar@isy.liu.se
  135.  
  136. ---------------------------
  137.  
  138. From: sw@network-analysis-ltd.co.uk (Sak Wathanasin)
  139. Subject: MPW C++ and "force_active" pragma
  140. Date: 12 Mar 92 16:11:55 GMT
  141. Organization: Network Analysis Ltd
  142.  
  143. I've been trying to use the #pragma force_active ON/OFF directives described
  144. in the ETO #6 release notes. Suppose I have a class TFooView that is instantiated
  145. when a view is created at runtime. My reading of the ETO #6 release notes
  146. led me to think that if I enclose all methods of TFooView inside
  147. #pragma force_active ON/OFF directives, the linker would include all such
  148. methods in the final build. I did this, and everything compiles, links etc,
  149. but whenever I open the view in question, I get a "Can't open because TFooView
  150. methods can't be found" message. I have to go back to using the gDeadStripSuppression
  151. trick. What am I missing? Can someone post an example of its use?
  152.  
  153. Thanks in advance.
  154.  
  155. Sak Wathanasin
  156. Network Analysis Limited
  157.  
  158. uucp:    ...!uknet!nan!sw
  159. other:    sw@network-analysis-ltd.co.uk
  160. phone:  (+44) 203 419996
  161. snail:  178 Wainbody Ave South, Coventry CV3 6BX, UK
  162.  
  163. +++++++++++++++++++++++++++
  164.  
  165. From: ksand@apple.com (Kent Sandvik)
  166. Date: 23 Mar 92 18:12:03 GMT
  167. Organization: MacDTS Mongols
  168.  
  169. In article <D2150050.uacqb3@nan.network-analysis-ltd.co.uk>,
  170. sw@network-analysis-ltd.co.uk (Sak Wathanasin) writes:
  171. > I've been trying to use the #pragma force_active ON/OFF directives described
  172. > in the ETO #6 release notes. Suppose I have a class TFooView that is
  173. instantiated
  174. > when a view is created at runtime. My reading of the ETO #6 release notes
  175. > led me to think that if I enclose all methods of TFooView inside
  176. > #pragma force_active ON/OFF directives, the linker would include all such
  177. > methods in the final build. I did this, and everything compiles, links etc,
  178. > but whenever I open the view in question, I get a "Can't open because TFooView
  179. > methods can't be found" message. I have to go back to using the
  180. gDeadStripSuppression
  181. > trick. What am I missing? Can someone post an example of its use?
  182.  
  183. Any pragmas which are inside a function statement won't work, because MPW C++
  184. will try to move them outside the function scope. Why? Because the CFront
  185. creates C code, and there are no guarantees where pragma statements inside 
  186. functions will suddenly end up. I.e. any possible 'force active' statements 
  187. have most likely moved. 
  188.  
  189. So the compiler tries to move any possible pragma statements to the one and
  190. only place it recognizes, the start of the function scope. This is documented
  191. in the new MPW C++ documentation, out in May. The documentation will describe
  192. each pragma in the C++ case, which work and which wont. Don't worry, pragma
  193. segment works, pragma unused wont...
  194.  
  195. Cheers,
  196. Kent
  197.  
  198.  
  199. - --
  200. Kent Sandvik/DTS - Dynamic Language Evangelist.
  201. Opinions expressed are private, and not owned by any company, 
  202. organization or group. Happy happy, joy joy!
  203.  
  204. ---------------------------
  205.  
  206. From: Jochen.Meyer@arbi.informatik.uni-oldenburg.de (Jochen Meyer)
  207. Subject: Finding out largest memory block in heap?
  208. Date: 23 Mar 92 09:54:28 GMT
  209. Organization: University of Oldenburg, Germany
  210.  
  211.  
  212. I am writing a program that needs large buffers of unspecified size. For
  213. this I need to get a memory block that is as large as possible. I know
  214. that I could use MaxMem or something like that to get the size of the
  215. largest block AFTER COMPRESSING THE HEAP.
  216.  
  217. What I need is a function that returns the size of the largest block that
  218. can be allocated without compressing the heap.
  219.  
  220. This is of particular interest for me, since I wish to use temporary memory
  221. and want to remain compatible to virtual memory. You know, compacting the
  222. entire free memory if it is of several Megs size and is located on hard
  223. disc seems to take quite some time (one minute or so).
  224.  
  225. Any answers are appreciated. Thanks!
  226.  
  227. Jochen
  228. Jochen.Meyer@arbi.informatik.uni-oldenburg.de
  229.  
  230. +++++++++++++++++++++++++++
  231.  
  232. From: d88-jwa@iswed.nada.kth.se (Jon W{tte)
  233. Date: 23 Mar 92 13:39:43 GMT
  234. Organization: Royal Institute of Technology, Stockholm, Sweden
  235.  
  236. > Jochen.Meyer@arbi.informatik.uni-oldenburg.de (Jochen Meyer) writes:
  237.  
  238.    I am writing a program that needs large buffers of unspecified size. For
  239.    this I need to get a memory block that is as large as possible. I know
  240.    that I could use MaxMem or something like that to get the size of the
  241.    largest block AFTER COMPRESSING THE HEAP.
  242.  
  243.    What I need is a function that returns the size of the largest block that
  244.    can be allocated without compressing the heap.
  245.  
  246. What's wrong with PurgeSpace ? It's in Inside Mac (IV, I believe)
  247. and returns the max amount that "could" be available, without
  248. actually making it available.
  249.  
  250. However, you might want to know how much is "safely" available ?
  251. That's anorther story; the memory manager will only purge/move
  252. blocks until it gets what it needs. The problem is, if you have two
  253. 8-byte blocks in the bottom of the heap, and you call NewPtr on a
  254. meg, the memory manager will leap-frog the blocks after each other
  255. all the way through the meg :-(
  256.  
  257. Since a purge is faster than a compaction, PurgeSpace may be better
  258. than MaxBlock, though.
  259.  
  260. - -- 
  261. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  262.  
  263. ---------------------------
  264.  
  265. From: fzstein@hamlet.ucdavis.edu (Dean Hickerson)
  266. Subject: Outlining default button in a dialog; FAQ list solution fails
  267. Date: 15 Mar 92 22:58:20 GMT
  268. Organization: Computing Services, UC Davis
  269.  
  270. I've been trying to draw an outline around the default button in a
  271. dialog box.  The FAQ list explains how to do this, by using a dummy
  272. useritem to draw the outline.  But it doesn't work if the button's
  273. height is too large:  That part of the outline that's within the default
  274. button's rectangle doesn't get drawn.  For buttons with the usual height
  275. of 20 pixels, there's no problem, because the outline doesn't intersect
  276. the button's rectangle.  The problem first occurs when the height is 34,
  277. and becomes very noticeable when the height is about 50.  If the height
  278. is 56 or larger, the outline is cut into 4 separate pieces.
  279.  
  280. Here's part of the FAQL's routine for drawing the outline:
  281.  
  282.           diameter = (itemRect.bottom - itemRect.top) / 2;
  283.           if ( diameter < 16 )
  284.               diameter = 16;
  285.           PenSize( 3, 3 );
  286.           InsetRect( &itemRect, -4, -4 );
  287.           FrameRoundRect( &itemRect, diameter, diameter );
  288.  
  289. If we just use 16 as the diameter, no matter how tall the rectangle is,
  290. the problem goes away.  However, the outline then has squarer corners
  291. than the button, which doesn't look great.
  292.  
  293. Has anyone else encountered this problem?  Why does it occur?  Is there
  294. a good solution?
  295.  
  296. Dean Hickerson
  297. drhickerson@ucdavis.edu
  298.  
  299. +++++++++++++++++++++++++++
  300.  
  301. From: lim@iris.ucdavis.edu (Lloyd Lim)
  302. Date: 19 Mar 92 09:30:05 GMT
  303. Organization: U.C. Davis - Department of Computer Science
  304.  
  305. In article <18566@aggie.ucdavis.edu> fzstein@hamlet.ucdavis.edu (Dean Hickerson) writes:
  306. >I've been trying to draw an outline around the default button in a
  307. >dialog box.  The FAQ list explains how to do this, by using a dummy
  308. >useritem to draw the outline.  But it doesn't work if the button's
  309. >height is too large [...]
  310. >
  311. >Here's part of the FAQL's routine for drawing the outline:
  312. >
  313. >          diameter = (itemRect.bottom - itemRect.top) / 2;
  314. >          if ( diameter < 16 )
  315. >              diameter = 16;
  316. >          PenSize( 3, 3 );
  317. >          InsetRect( &itemRect, -4, -4 );
  318. >          FrameRoundRect( &itemRect, diameter, diameter );
  319. >
  320. >If we just use 16 as the diameter, no matter how tall the rectangle is,
  321. >the problem goes away.  However, the outline then has squarer corners
  322. >than the button, which doesn't look great.
  323. >
  324. >Has anyone else encountered this problem?  Why does it occur?  Is there
  325. >a good solution?
  326.  
  327. You're having problems simply because the code is not calculating the
  328. diameter correctly.  I never bothered double-checking the FAQ code because
  329. I thought it was just handling the standard 20 pixel height case.
  330.  
  331. Here is some code that will look ok with any button size:
  332. (using variable names similar to those above)
  333.  
  334. InsetRect(&itemRect, -4, -4);
  335. diameter = ((itemRect.bottom - itemRect.top) >> 1) + 3;
  336. PenSize(3, 3);
  337. FrameRoundRect(&itemRect, diameter, diameter);
  338.  
  339. This is the same formula that I use in Default, the world's most anal
  340. retentive default button outline drawing code.  If you really want to do
  341. a prefect job, look at Default to see how to handle inactive buttons,
  342. control color tables, System 7 dimming, and optimal display when straddling
  343. monitors.  Disclaimer:  I wrote Default.  :-)
  344.  
  345. Another Macintosh programmer at U.C. Davis...  outstanding!!!
  346. Feel free to send me e-mail about anything.
  347.  
  348. +++
  349. Lloyd Lim     Internet: lim@cs.ucdavis.edu
  350.               America Online: LimUnltd
  351.               Compuserve: 72647,660
  352.               US Mail: 224 Lysle Leach Hall, U.C. Davis, Davis, CA 95616
  353.  
  354. +++++++++++++++++++++++++++
  355.  
  356. From: fzstein@hamlet.ucdavis.edu (Dean Hickerson)
  357. Date: 23 Mar 92 22:34:35 GMT
  358. Organization: Computing Services, UC Davis
  359.  
  360. In a previous posting, I said:
  361.  
  362. >  I've been trying to draw an outline around the default button in a
  363. >  dialog box.  The FAQ list explains how to do this, by using a dummy
  364. >  useritem to draw the outline.  But it doesn't work if the button's
  365. >  height is too large:  That part of the outline that's within the default
  366. >  button's rectangle doesn't get drawn.  For buttons with the usual height
  367. >  of 20 pixels, there's no problem, because the outline doesn't intersect
  368. >  the button's rectangle.  The problem first occurs when the height is 34,
  369. >  and becomes very noticeable when the height is about 50.  If the height
  370. >  is 56 or larger, the outline is cut into 4 separate pieces.
  371.  
  372. Thanks to Lloyd Lim (lim@cs.ucdavis.edu) my problem has been solved.  My
  373. dialog's "Initially visible" bit was true and I was calling ModalDialog
  374. without calling ShowWindow first.  Setting the bit to false and calling
  375. ShowWindow makes the problem go away.
  376.  
  377. Now that I know what to look for, I see that Inside Macintosh actually
  378. contains an explanation of this.  The description of the function NewDialog
  379. (volume I, chapter 13) says that control items are drawn immediately, but
  380. other items aren't drawn until after the update event (which NewDialog
  381. generates).  So, to avoid drawing controls twice, the Dialog Manager calls
  382. ValidRect for the enclosing rectangle of each control.
  383.  
  384. Thanks to Lloyd and the others who replied.
  385.  
  386. Dean Hickerson
  387. drhickerson@ucdavis.edu
  388.  
  389. ---------------------------
  390.  
  391. From: kent@sunfs3.Camex.COM (Kent Borg)
  392. Subject: Electronic Publishing, That Is, Without Paper
  393. Date: 20 Mar 92 18:54:03 GMT
  394. Organization: Camex Inc., Boston MA
  395.  
  396.  
  397. I am interested in contacting people who are interested in "Electronic
  398. Publishing".  But I mean *real* electronic publishing, publishing
  399. where the content never hits paper.
  400.  
  401. Now that Powerbooks are popping up everywhere there is an audience
  402. brewing.  For example: Camex (where I work) is not that big and is
  403. mostly populated with Suns.  Until recently I knew of exactly one
  404. notebook computer floating around here, some MS-DOS box.  Now I know
  405. of three 170's (it has become a status symbol), a 100, and my personal
  406. 140.  I am sure there are more to come.  There was a co-worker asking
  407. me about prices just a few minutes ago.
  408.  
  409. If you too have thought about the issues involved in real electronic
  410. publishing: How to program it, how to design the user interface, how
  411. to produce content, I am interested in hearing from you.
  412.  
  413.  
  414. - --
  415. Kent Borg                            internet: kent@camex.com   AOL: kent borg
  416.                                             H:(617) 776-6899  W:(617) 426-3577
  417. "Eating healthy beef is not healthful, the steer will take offense at you
  418. chewing on his flanks."      -me
  419.  
  420. +++++++++++++++++++++++++++
  421.  
  422. From: davidm@sfsuvax1.sfsu.edu (David Morgenstern)
  423. Organization: San Francisco State University
  424. Date: Mon, 23 Mar 1992 18:22:11 GMT
  425.  
  426. The Association of Research Libraries has a list (and now a book)
  427. of electronically published Journals and Newsletters, and
  428. Discussion Lists (listservs) and Interest Groups (Newsgroups). It's
  429. called the Directory of Electronic Journals, Newsletters, and
  430. Academic Discussion Lists. I think you can get a copy of the list
  431. from Ann Okerson at okerson@umdc.umd.edu
  432.  
  433. daviD
  434. - -- 
  435. *****     David Morgenstern (a.k.a. BMUG CheerLeader)     *****
  436. *     CIS: 72030,1607   AOL: daviD eM   FAX: 510-849-9026     *
  437.  
  438. ---------------------------
  439.  
  440. From: johnsd2@jec307.its.rpi.edu (Daniel Norman Johnson)
  441. Subject: Info on Copyrights and Distribution
  442. Organization: Information Technology Services, Rennselaer Polytechnic Institute.
  443. Date: Fri, 20 Mar 1992 23:04:19 GMT
  444.  
  445. Hello one and all. I have written 2 small Macintosh apps (well App and
  446. Background App) that I would like to distribute as freeware (they play
  447. sounds in the background, if you care)
  448.  
  449. Unforunately I do not know how to do this. Could somebody tell me?
  450.  
  451. Also, they are written in Think C. Symantec's licencing agreement sez that all I
  452. have to do is have a copyright that covers their copyright on Think Cs run time
  453. junk. However, I do not have such a copyright. I don't really want one, or know
  454. how to get one either.
  455.  
  456. I have noticed that some things I have run in too (sorry, can't remember
  457. any examples) have a "Portions Copyright Symantec [etc etc etc]".
  458. Is this enough? Does anybody care about such things when the software isn't
  459. commercial? Am I just being paranoid? :)
  460.  
  461. Ah well, thanks in advance.
  462. - -- 
  463.             - Dan Johnson
  464. And God said "Jeeze, this is dull"... and it *WAS* dull. Genesis 0:0
  465.  
  466. +++++++++++++++++++++++++++
  467.  
  468. From: tinsel@uiuc.edu (Thomas Aaron Insel)
  469. Date: 20 Mar 92 23:48:34 GMT
  470. Organization: University of Illinois at Urbana
  471.  
  472. johnsd2@jec307.its.rpi.edu (Daniel Norman Johnson) writes:
  473.  
  474. >Also, they are written in Think C. Symantec's licencing agreement sez that all I
  475. >have to do is have a copyright that covers their copyright on Think Cs run time
  476. >junk. However, I do not have such a copyright. I don't really want one, or know
  477. >how to get one either.
  478.  
  479. >I have noticed that some things I have run in too (sorry, can't remember
  480. >any examples) have a "Portions Copyright Symantec [etc etc etc]".
  481. >Is this enough? Does anybody care about such things when the software isn't
  482. >commercial? Am I just being paranoid? :)
  483.  
  484. Just put a line in your about-box and your version resource that says
  485. "Copyright 1992 Daniel Norman Johnson.  Permission is hereby granted to
  486. distribute unmodified copies of this software."  Your software will be
  487. copyrighted, but it is clear that anyone can distribute it as freeware,
  488. and Symantec will be happy.  You could spend $10 (or did they raise it
  489. to $20) to register the copyright, but unless you plan on sueing someone
  490. for copying your application, which sounds unlikely, it's a waste.
  491. - -- 
  492. Thomas Aaron Insel (tinsel@uiuc.edu)
  493.   s-mail: URH 227 Saunders, 906 W. College, Urbana IL 61801
  494.   I speak for myself, and not for the State or University of Illinois.
  495.   "We must not confuse dissent with disloyalty." -- Edward R. Murrow
  496.  
  497. +++++++++++++++++++++++++++
  498.  
  499. From: ts@cup.portal.com (Tim W Smith)
  500. Date: 21 Mar 92 06:28:48 GMT
  501. Organization: The Portal System (TM)
  502.  
  503. > and Symantec will be happy.  You could spend $10 (or did they raise it
  504. > to $20) to register the copyright, but unless you plan on sueing someone
  505. > for copying your application, which sounds unlikely, it's a waste.
  506.  
  507. They raised it to $20.00.  I believe that you can still sue even without
  508. registering.  However, you can only collect actual damages, which are
  509. hard to prove (especially if you are giving it away!).  You might
  510. not even be able to do this.  You can still sue to stop the infringement,
  511. though.
  512.  
  513. With registration, you can collect statutory damages.  Basically, that
  514. means that the Court will say, "Oh hell, it's hard to figure out how
  515. much you were damaged.  Let's just call it $XXXX."
  516.  
  517. For more information, ask on misc.legal, misc.int-property, or
  518. misc.legal.computing.  Or, if you can wait, I'll be entering law
  519. school in September, so if you send me email in 1995, I'll be
  520. able to provide a definitive answer then. :-)
  521.  
  522. ---------------------------
  523.  
  524. From: davison@inferno.rutgers.edu (Brian D. Davison)
  525. Subject: Can anyone tell me about Prototyper?
  526. Date: 22 Mar 92 16:48:36 GMT
  527. Organization: Rutgers Univ., New Brunswick, N.J.
  528.  
  529.  
  530. The subject says it.  I heard about a package called Prototyper in the
  531. docs of a shareware game, and thought it sounded interesting - an
  532. interactive interface builder for the Mac.  Linkable with Pascal, C,
  533. etc.  Anyway, I can't find it in any of my Mac software catalogs or
  534. magazines.  I even searched the net in case it was a shareware
  535. product, but all I came up with was an old demo (v2.1) from 1989 or
  536. so, which said it was written by George R. Cossey and published by
  537. SmethersBarnes.  Its a decent demo, and I'm still interested, but no
  538. address, phone number, price, etc.
  539.  
  540. Failing this, what other interface builing packages are out there?
  541. I'd like something that would generate function outlines to control
  542. the interface as well as set up the resources, etc.  I'm fairly
  543. comfortable with ResEdit, but I'm not the only one going to use this
  544. package and we'd like something that would generate some of its own
  545. code.  No, I'm not asking Microsoft to port VisualBASIC to the Mac,
  546. but if you've seen VisualBASIC, you've got an idea of what we're
  547. looking for.
  548. - -- 
  549. Brian D. Davison                    Department of Computer Science
  550.                                     Hill Center, Busch Campus
  551. davison@paul.rutgers.edu            Rutgers, The State University of New Jersey
  552. !rutgers!paul.rutgers.edu!davison   New Brunswick, NJ  08903
  553.  
  554. +++++++++++++++++++++++++++
  555.  
  556. From: robichau@lambda.msfc.nasa.gov (Paul Robichaux)
  557. Organization: New Technology, Inc.
  558. Date: Mon, 23 Mar 1992 21:18:01 GMT
  559.  
  560. In <Mar.22.11.48.35.1992.6316@inferno.rutgers.edu> davison@inferno.rutgers.edu (Brian D. Davison) writes:
  561.  
  562. >product, but all I came up with was an old demo (v2.1) from 1989 or
  563. >so, which said it was written by George R. Cossey and published by
  564. >SmethersBarnes.  Its a decent demo, and I'm still interested, but no
  565. >address, phone number, price, etc.
  566.  
  567.  As far as I know, Prototyper has been replaced by Marksman. Same basic
  568.  product, same developer, different name. I don't know if Marksman ever
  569.  became available for sale.
  570.  
  571. >Failing this, what other interface builing packages are out there?
  572. >I'd like something that would generate function outlines to control
  573. >the interface as well as set up the resources, etc.  I'm fairly
  574. >comfortable with ResEdit, but I'm not the only one going to use this
  575. >package and we'd like something that would generate some of its own
  576. >code.  No, I'm not asking Microsoft to port VisualBASIC to the Mac,
  577. >but if you've seen VisualBASIC, you've got an idea of what we're
  578. >looking for.
  579.  
  580. AppMaker, from Bowers Development, was recommended to me by postings in
  581. this group. I've been using it for about two weeks and recommend it highly.
  582.   Pros: can generate code for MPW/Think, Pascal/C, with/without MacApp/TCL.
  583.         generated programs are Sys7-friendly
  584.         generated code is readable and (so far) very stable
  585.         has *lots* of interface options
  586.     
  587.   Cons: interface is sometimes counterintuitive
  588.         can't switch a prototype between languages
  589.         
  590. It helps to do your whole interface first, because once you have AppMaker 
  591. generate code, if you make changes to that code, you'll have to reintegrate
  592. it into the generated modules if you make changes.
  593.  
  594. Overall, though, AppMaker is solid and fairly easy to use. Two thumbs up.
  595. (The only mail-order place that had it in stock was Mac's Place, for $217.)
  596.  
  597. And no, it's not Visual Basic.
  598.  
  599. - -Paul
  600. - -- 
  601. Paul Robichaux, KD4JZG          | NTI doesn't pay for my opinions, and NASA
  602. robichau@lambda.msfc.nasa.gov   | doesn't know I have any.
  603.          This message printed on recycled phosphors.
  604.  
  605.  
  606. ---------------------------
  607.  
  608. From: kroger@tinman.cognet.ucla.edu (James Kroger)
  609. Subject: OOP version of ThinkC
  610. Date: 22 Mar 92 19:47:16 GMT
  611. Organization: none
  612.  
  613. 1) Will ThinkC have full object oriented capabilities
  614. in the forseeable future, or is MPW the only option?
  615.  
  616. 2) What object oriented programming capabilities does ThinkC
  617. currently lack?
  618.  
  619. Thanks for any info..
  620.  
  621. - --Jim
  622.  
  623. +++++++++++++++++++++++++++
  624.  
  625. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  626. Date: 22 Mar 92 21:17:54 GMT
  627. Organization: Royal Institute of Technology, Stockholm, Sweden
  628.  
  629. .ucla.edu> kroger@tinman.cognet.ucla.edu (James Kroger) writes:
  630.  
  631.    1) Will ThinkC have full object oriented capabilities
  632.    in the forseeable future, or is MPW the only option?
  633.  
  634. Yes. Right about two years ago or so, when 4.0 came out.
  635.  
  636.    2) What object oriented programming capabilities does ThinkC
  637.    currently lack?
  638.  
  639. No "OO" features (except multiple inheritance)
  640.  
  641. It has polymorphism, inheritance, data hiding, ... all the
  642. things that there's no argument about being required for an
  643. "OO" language. However, automatic constructors/destructors,
  644. and statical scope for instances, are not in there.
  645.  
  646. As for what features Think C 6.0 will have, you'll have to
  647. know that Symantec is VERY secretive about what they're
  648. doing...
  649.  
  650. - -- 
  651. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  652.  
  653. +++++++++++++++++++++++++++
  654.  
  655. From: dent@DIALix.oz.au (Andrew Dent)
  656. Organization: DIALix Services, Perth, Western Australia
  657. Date: Mon, 23 Mar 92 11:08:11 GMT
  658.  
  659. I'd like to point out a couple of OOP features that Think C has that are 
  660. lacking in C++ and satisfy needs that people write some AWFUL C++ code to
  661. work around (see comp.object for discussions).
  662.  
  663. Namely
  664.  
  665. member()
  666. class_name()
  667. new_by_name()
  668.  
  669. These three functions are very important for certain sorts of activity
  670. (such as implementing persistence) and in particular the member() function
  671. let's you implement similar features to parameterized classes (eg: containers
  672. that sometimes DO have to know the class of their objects).
  673.  
  674. Andy Dent
  675. A.D. Software - Mac, PC & Vax Programming and Training
  676. 94 Bermuda Dve, BALLAJURA  Western Australia  6066
  677. Phone/Fax: 09 249 2719 (local)  +619 249 2719 (International)
  678.        Internet: dent@DIALix.oz.au    Compuserve: 100033,3241
  679. "It's amazing what one can accomplish when one doesn't know 
  680.  what one can't do" (Garfield)
  681.  
  682.  
  683. ---------------------------
  684.  
  685. From: erh0362@tesla.njit.edu
  686. Subject: malloc() problem solved
  687. Date: 22 Mar 92 20:22:09 GMT
  688. Organization: New Jersey Institute of Technology
  689.  
  690.  
  691.     Thanks to everyone who responded to my post asking for help with
  692. malloc() and calloc(). The problem has been solved. Several people
  693. suggested that I needed to #include <stdlib.h> which I was already
  694. doing. A few others suggested that I make sure I was using two-byte ints
  695. instead of four-bytes, but that's not an option in THINK C 4.0 which
  696. automatically defaults to 2-byte ints. The real problem was diagnosed by
  697. Phil Shapiro of Symantec (Cheers for Symantec and all other companies
  698. that provide Internet tech support.) who guessed that I might be writing
  699. beyond the bounds of a previously malloced array. That was apparently
  700. the problem since after going through the previous malloc() calls and
  701. paying more careful attention to how much space they were allocating,
  702. the program ran perfectly.     
  703.  
  704.     According to Phil writing beyond the bounds of an array may cause later
  705. calls to malloc() to crash. That strikes me as funny since I'd suspect
  706. the crashing to occur just about anywhere else, perhaps when I
  707. accidentally overwrote something, or the memory manager moved an
  708. important chunk of memory I thought I had locked down. My expectation
  709. would be that a future malloc() would just grab some of what I thought
  710. was the old malloc(), but I don't see why this would crash malloc()
  711. itself. Nonetheless that's what was apparently happening. It also
  712. appears that gcc 2.0 for UNIX is a lot more forgiving of this sort of
  713. programmer mistake than Think C. If only there were a language that
  714. simply let you dynamically dimension arrays (int array[x][y])  all this
  715. would have been moot. 
  716.     Once again thanks to everyone for your suggestions and help.
  717.  
  718. Elliotte Rusty Harold        Department of Applied Mathematics
  719. elharo@m.njit.edu        New Jersey Institute of Technology
  720. erh0362@tesla.njit.edu        Newark, NJ 07103
  721.  
  722. +++++++++++++++++++++++++++
  723.  
  724. From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher)
  725. Date: 23 Mar 92 14:20:52 GMT
  726. Organization: Integrated Systems Laboratory, ETH, Zurich
  727.  
  728. In article <1992Mar22.152209.1@tesla.njit.edu> erh0362@tesla.njit.edu writes:
  729. >    According to Phil writing beyond the bounds of an array may cause later
  730. >calls to malloc() to crash. That strikes me as funny [...]
  731.  
  732. With memory overwrite bugs, a good sense of humor is often quite useful :-)
  733.  
  734. >My expectation
  735. >would be that a future malloc() would just grab some of what I thought
  736. >was the old malloc(), but I don't see why this would crash malloc()
  737. >itself.
  738.  
  739. Probably because THINKL malloc has not only a "next malloc starts there"
  740. pointer, but more sophisticated data structures in the heap itself.
  741.  
  742. >It also
  743. >appears that gcc 2.0 for UNIX is a lot more forgiving of this sort of
  744. >programmer mistake than Think C.
  745.  
  746. Unix mallocs tend to hand out malloced memory in larger chunks (buddy system,
  747. for example, rounds the alloc request to the next higher power of two) and are
  748. therefore more tolerant of slight overwrites.
  749.  
  750. Matthias
  751.  
  752. - -----
  753. Matthias Neeracher                                   neeri@iis.ethz.ch
  754.    "One fine day in my odd past..." -- Pixies, _Planet of Sound_
  755.  
  756. +++++++++++++++++++++++++++
  757.  
  758. From: time@ice.com (Tim Endres)
  759. Date: 23 Mar 92 14:22:11 GMT
  760. Organization: ICE Engineering, Inc.
  761.  
  762.  
  763. In article <1992Mar22.152209.1@tesla.njit.edu> (comp.sys.mac.programmer), erh0362@tesla.njit.edu writes:
  764. >     According to Phil writing beyond the bounds of an array may cause later
  765. > calls to malloc() to crash. That strikes me as funny since I'd suspect
  766. > the crashing to occur just about anywhere else, perhaps when I
  767. > accidentally overwrote something, or the memory manager moved an
  768. > important chunk of memory I thought I had locked down. My expectation
  769. > would be that a future malloc() would just grab some of what I thought
  770. > was the old malloc(), but I don't see why this would crash malloc()
  771. > itself. Nonetheless that's what was apparently happening. It also
  772.  
  773. Well, you must remember that malloc() is using part of the memory
  774. space you are allocating from to keep track of the memory allocation.
  775. In fact, most malloc()'s put this data *right in front* of the memory
  776. you are handed back. Thus, if you overwrite a piece of memory, you
  777. are generally also overwriting the private information just in front
  778. of the next allocated pointer. Thus, it follows that you would experience
  779. the most failures on your next call to malloc() which would go flying
  780. off into space tracker bad information about the memory space.
  781.  
  782. tim.
  783.  
  784.  
  785. tim endres - time@ice.com  -or-  uupsi!tbomb!time
  786. ICE Engineering, Inc. - Phone (313) 449 8288 - FAX (313) 449-9208
  787. 8840 Main Street, Whitmore Lake, MI  48189
  788. USENET - a slow moving self parody... ph
  789.  
  790. ---------------------------
  791.  
  792. From: pers@ifi.uio.no (Per Siljubergs}sen)
  793. Subject: KCAP resource format?
  794. Date: 22 Mar 92 22:06:19 GMT
  795. Organization: Dept. of Informatics, University of Oslo, Norway
  796.  
  797. Inside Mac VI describes the KCAP resource, but it lacks info about
  798. how it's used. Here is the rez format of the KCAP resource:
  799.  
  800. type 'KCAP' {
  801.       rect;                             /* boundsRect of keyboard */
  802.       rect;                             /* textRect, used by KeyCaps */
  803.       integer = $$CountOf(MainArray);
  804.       array MainArray {
  805.          integer = $$CountOf(ShapeArray) - 1;
  806.          wide array ShapeArray {
  807.             point;       /* shapePoint, how are keys shaped? */
  808.          };
  809.          integer = $$CountOf(KeyArray) - 1;
  810.          wide array KeyArray {
  811.             byte;                 /* mask, but for what? */
  812.             boolean or, and;      /* what is this operand used for? */
  813.             bitstring[7];         /* virtual keyCode */
  814.             integer;              /* dv, vertical offset of key */
  815.             integer;              /* dh, horizontal offset of key */
  816.          };
  817.       };
  818. };
  819.  
  820. Here are my questions:
  821.  
  822. How do I use the ShapeArray to shape none-rectangle keys?
  823. What are the KeyArray's mask field used for?
  824. What are the KeyArray's boolean (or,and) field used for?
  825.  
  826. Really hope anyone can help me with this.
  827.  
  828. +++++++++++++++++++++++++++
  829.  
  830. From: grobbins@Apple.COM (Grobbins)
  831. Date: 24 Mar 92 04:04:45 GMT
  832. Organization: Apple DTS
  833.  
  834. In article <1992Mar22.220619.26413@ifi.uio.no> pers@ifi.uio.no (Per Siljubergs}sen) writes:
  835. >Inside Mac VI describes the KCAP resource, but it lacks info about
  836. >how it's used.
  837.  
  838. KCAP resources describe the key layout of Macintosh keyboards. They are 
  839. intended for use by the Key Caps desk accessory, but applications can also 
  840. take advantage of KCAPs for information about key arrangements. The program 
  841. kcapApp demonstrates use of the KCAP resource and is available in the Snippets 
  842. collection on the Developer CD and, presumably, on ftp.apple.com.
  843.  
  844. This is the format of the KCAP resource.
  845.  
  846.   rect, boundary for the keyboard (8 bytes)
  847.   rect, appropriate for an editable line of text (8 bytes)
  848.   integer, number of key shapes to follow (2 bytes)
  849.   
  850.   for each key shape:
  851.     integer, number of points defining this key shape - 1 (2 bytes)
  852.     for each point:
  853.       point, opposite corner of a rect (2 bytes)
  854.  
  855.     number of keys of this shape - 1 (2 bytes)
  856.     for each key:
  857.       byte, modifier mask (1 byte)
  858.       byte, OR/AND setting for modifier mask (1 bit) plus
  859.         virtual keycode for this key (7 bits)
  860.       integer, vertical offset from previous key (2 bytes)
  861.       integer, horizontal offset from previous key (2 bytes)
  862.  
  863. The keyboard boundary rect may be offset from the origin. It can be realigned 
  864. with
  865.     OffsetRect(keybdRect, - keybdRect.left, - keybdRect.top)
  866.  
  867. Each key shape consists of one or more rectangles.  The rectangles are defined 
  868. by a series of points, with one point specifying each rectangle.  The first 
  869. point is the opposite corner of a rectangle anchored at the starting pen 
  870. location for the key;  the next point is the opposite corner of a rectangle 
  871. from the last point; and so on.  The key shape is the union of the rects 
  872. defined by the points.
  873.  
  874. Note that a rectangle's point may be above or to the left of the previous 
  875. point.  To QuickDraw, this would define an empty rectangle, so the rectangle's 
  876. horizontal and/or vertical coordinates may need to be swapped before FrameRect 
  877. is called to add a rect to the key's region.
  878.  
  879. The pen is moved to the top left of the keyboard boundary rect before drawing 
  880. each group of keys of a given shape.  The pen location for each key is given 
  881. as a horizontal and vertical offset from the pen location for the previous 
  882. key.  The pen location for the first key of each shape is an offset from the 
  883. top left corner of the keyboard boundary rectangle.  The pen does not change 
  884. location when a key is drawn.
  885.  
  886. Use KeyTrans to determine the character to be drawn on the key.  The resource 
  887. provides a 7-bit virtual keycode, plus a mask for the modifiers to be passed 
  888. to KeyTrans.  If the most significant bit of the keycode byte is set, AND the 
  889. desired modifiers with the modifier mask.  If the bit is clear, OR the 
  890. modifiers with the mask.
  891.  
  892. The high bit of the virtual keycode byte indicates to KeyTrans the type of the 
  893. keystroke; before calling KeyTrans, clear the bit for a keydown, or set it for 
  894. a keyup. KeyTrans sets the state appropriately for dead keys only when called 
  895. for keydowns.
  896.  
  897. The global KbdType ($21E), a byte, contains the KCAP resource number for the 
  898. last keyboard used. Under System 6, KCAP resources are kept in the file "Key 
  899. Layout" in the System folder. Starting with System 7, KCAP resources are in 
  900. the System file. Alternatively, a machine's KCAP may be stored in ROM, where 
  901. it is available with the RGetResource call but cannot be viewed with ResEdit.
  902.  
  903. For more information on KeyTrans and KCHRs, see chapter 10 of Inside Macintosh 
  904. volume V, pages 14-23 and 14-96 of Inside Macintosh volume VI, and Macintosh 
  905. Technical Note #160. KCAP resources are discussed on pages 14-95, 14-100 and 
  906. 14-101 of Inside Macintosh volume VI.
  907.  
  908. Grobbins        grobbins@apple.com
  909.  
  910. Usual disclaimers apply.
  911.  
  912.  
  913. ---------------------------
  914.  
  915. From: jerome@ee.fit.edu (Jerome Chan)
  916. Subject: THINK C Problem
  917. Date: 22 Mar 92 19:47:47 GMT
  918. Organization: Florida Tech, CP/EE Dept.
  919.  
  920. I keep getting an error when I do this:
  921.  
  922.  
  923. class CMailer : public CApplication    {
  924.  
  925.     protected:
  926.         Boolean    fAboutBox=false ;
  927. }
  928.  
  929.  
  930. - --
  931.  The Evil Tofu
  932.  
  933.  
  934. +++++++++++++++++++++++++++
  935.  
  936. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  937. Date: 23 Mar 92 08:10:17 GMT
  938. Organization: Royal Institute of Technology, Stockholm, Sweden
  939.  
  940. @ee.fit.edu (Jerome Chan) writes:
  941.  
  942.    I keep getting an error when I do this:
  943.  
  944.    class CMailer : public CApplication    {
  945.  
  946.        protected:
  947.            Boolean    fAboutBox=false ;
  948.    }
  949.  
  950.  
  951.  
  952. Think C has no "friend" concept... And you can't initialize
  953. members in the declaration. Remove fAboutBox = false ;
  954.  
  955. - -- 
  956. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  957.  
  958. +++++++++++++++++++++++++++
  959.  
  960. From: d88-sli@juodas.nada.kth.se (Stefan Lindmark)
  961. Date: 23 Mar 92 10:11:29 GMT
  962. Organization: Royal Institute of Technology, Stockholm, Sweden
  963.  
  964. In article <D88-JWA.92Mar23091017@hemul.nada.kth.se> d88-jwa@hemul.nada.kth.se (Jon W{tte) writes:
  965.  
  966.    @ee.fit.edu (Jerome Chan) writes:
  967.  
  968.       I keep getting an error when I do this:
  969.  
  970.       class CMailer : public CApplication    {
  971.  
  972.           protected:
  973.               Boolean    fAboutBox=false ;
  974.       }
  975.  
  976.  
  977.  
  978.    Think C has no "friend" concept... And you can't initialize
  979.    members in the declaration. Remove fAboutBox = false ;
  980.  
  981. In addition to this, you have to put ';' at the end of a class declaration.
  982.  
  983. - --
  984. Stefan Lindmark, Mambootor Datakonsult
  985. Smedbyvagen 40, 184 32 Akersberga, Sweden. Phone: +46 764 63864
  986.  
  987. ---------------------------
  988.  
  989. From: admiral.uucp!halifax@uunet.uu.net (Nathan Neulinger)
  990. Subject: Does anyone have any source code/file formats for graphics files
  991. Organization: The Grid/Waffle BBS, 203-661-2873, -1279, -0450, -2967
  992. Date: Sun, 22 Mar 1992 19:29:47 GMT
  993.  
  994. such as .GIF, or .PICT? Currently I am working in Think C, and need to 
  995. output an array of integers (2 dim), as an image, i have no problem 
  996. displaying it on the screen, but I need to be able to output it in other 
  997. formats such as MacPaint file, or a GIF file etc... In addition, once I 
  998. have the problem with exporting in black and white solved... I will need 
  999. to be able to export in 8 color, and 256 colors.
  1000.  
  1001. Also, Since I currently only own copies of Inside Macintosh vols 1 thru 
  1002. 3, would anyone care to share with me some sample code for 
  1003. displaying/drawing in 256 colors? I have not problem displaying in 8 
  1004. colors since that is covered in IM 1: QuickDraw...
  1005.  
  1006. Any assistance would be greatly appreciated...
  1007.  
  1008. Nathan Neulinger
  1009.  
  1010. - --
  1011. admiral!halifax@uunet.uu.net (Nathan Neulinger) <uunet!admiral!halifax>
  1012. The Admiral's Public UNIX - Greenwich, CT - System Administrator: Doug Fields
  1013. (HST/V32) (203)661-2873 -- (PEP/V32) -1279 -- (V32) -0450 -- (V29/MNP6) -2967
  1014. >FREE!< Unix shell accounts, Usenet access, and Internet-style mail available
  1015.  
  1016. +++++++++++++++++++++++++++
  1017.  
  1018. From: russotto@eng.umd.edu (Matthew T. Russotto)
  1019. Date: Mon, 23 Mar 92 15:27:14 GMT
  1020. Organization: College of Engineering, University of Maryland, College Park
  1021.  
  1022. In article <coy2HB1w164w@admiral.uucp> admiral.uucp!halifax@uunet.uu.net (Nathan Neulinger) writes:
  1023. >such as .GIF, or .PICT? Currently I am working in Think C, and need to 
  1024. >output an array of integers (2 dim), as an image, i have no problem 
  1025. >displaying it on the screen, but I need to be able to output it in other 
  1026. >formats such as MacPaint file, or a GIF file etc... In addition, once I 
  1027. >have the problem with exporting in black and white solved... I will need 
  1028. >to be able to export in 8 color, and 256 colors.
  1029.  
  1030. PICT format is documented in Inside Mac volume V, and tech notes.
  1031. Basically, write the contents of a picture handle (created by
  1032. OpenPicture/ClosePicture) preceded by 512 bytes of zero to the data
  1033. fork of a file.  Same thing works for color pictures if you have Color
  1034. Quickdraw.  I believe the TIFF and GIF formats are both up on
  1035. sumex-aim.stanford.edu.  TIFF is a real bear to read, but not too hard
  1036. to write-- easier than GIF because you don't need a compressor, and
  1037. more portable than PICT.
  1038.  
  1039. >Also, Since I currently only own copies of Inside Macintosh vols 1 thru 
  1040. >3, would anyone care to share with me some sample code for 
  1041. >displaying/drawing in 256 colors? I have not problem displaying in 8 
  1042. >colors since that is covered in IM 1: QuickDraw...
  1043.  
  1044. Too hard to explain in a message-- buy or borrow Inside Mac V.
  1045. - -- 
  1046. Matthew T. Russotto    russotto@eng.umd.edu    russotto@wam.umd.edu
  1047. Some news readers expect "Disclaimer:" here.
  1048. Just say NO to police searches and seizures.  Make them use force.
  1049. (not responsible for bodily harm resulting from following above advice)
  1050.  
  1051. ---------------------------
  1052.  
  1053. End of C.S.M.P. Digest
  1054. **********************
  1055.